<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="order/include :: header"></head>

<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
					    <!-- <div class="columns pull-right" role="group">
							<button class="btn btn-success" onclick="reLoad()">
								<i class="fa fa-edit" aria-hidden="true"></i>选择非直邮清单
							</button>
						</div> -->
						<div class="form-horizontal m-t" id="signupForm">
							<input type="hidden" th:value="${nodirectList.id}" id="id" name="id">
							<table class="table table-bordered table-condensed">
								<tbody>
								<tr>
									<th class="required" >ID:</th>
									<td th:text="${nodirectList.id}"></td>
									<th class="required" >名称:</th>
									<td th:text="${nodirectList.listName}"></td>
									<th class="required" >时间范围:</th>
									<td th:text="${#dates.format(nodirectList.orderStime,'yyyy-MM-dd HH:mm:ss')}+'至'+${#dates.format(nodirectList.orderEtime,'yyyy-MM-dd HH:mm:ss')}"></td>
								</tr>
								<tr>
									<th class="required" >地区:</th>
									<td th:text="${nodirectList.province}+${nodirectList.city}"></td>
									<th class="required" >创建时间:</th>
									<td th:text="${#dates.format(nodirectList.createTime,'yyyy-MM-dd HH:mm:ss')}"></td>
									<th class="required" >备注:</th>
									<td th:text="${nodirectList.remark}"></td>
								</tr>
								</tbody>
							</table>
						</div>

						<div class="ibox-title">
							<h5>线路明细</h5>
						</div>
						<div class="form-horizontal m-t">
							<table class="table table-bordered table-condensed">
								<thead>
									<tr>
										<th>ID</th>
										<th>线路</th>
										<th>仓库</th>
										<th width="35%">操作</th>
									</tr>
								</thead>
								<tbody>
								<tr th:each="item:${nodirectList.cars}">
									<td th:text="${item.id}"></td>
									<td th:text="${item.username}"></td>
									<td th:text="${item.storeroom}"></td>
									<td  align="center">
									    <a class="btn btn-primary btn-sm" href="#" title="导出物流清单" onclick="exportDetail(this)">
									       <input type="hidden" th:value="${nodirectList.id}" name="id">
									       <input type="hidden" th:value="${item.id}" name="carId">
									       <i class="fa fa-mail-reply-all"></i>导出物流清单</a>
									    <a class="btn btn-primary btn-sm" href="#" title="查看门店清单" onclick="seeCommander(this)">
									       <input type="hidden" th:value="${nodirectList.id}" name="id">
									       <input type="hidden" th:value="${item.id}" name="carId">
									       <i class="fa fa-eye"></i>查看门店清单
									    </a>
									    <a class="btn btn-primary btn-sm" href="#" title="打印清单" onclick="printDetail(this)">
									       <input type="hidden" th:value="${nodirectList.id}" name="id">
									       <input type="hidden" th:value="${item.id}" name="carId">
									       <i class="fa fa-print"></i>打印清单
									    </a>
									</td>
								</tr>
								</tbody>
							</table>
							<table>

							</table>
							<div class="form-group text-center">
								<div class="col-sm-8 col-sm-offset-2">
									<div class="btn btn-danger" onclick="closeDow()"><i class="fa fa-remove"></i> 关闭</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div th:include="order/include::footer"></div>
	<script type="text/javascript">
		function closeDow() {
			var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
			parent.layer.close(index);
		}

		var prefix = "/nodirectList/manage";
		
		function seeCommander(obj) {
			var id = obj.children[0].value;
			var carId = obj.children[1].value;
			var paras = id + "," + carId;
		    layer.open({
		        id:'nodirect_seeCommander',
		        type : 2,
		        title : '查看门店清单',
		        maxmin : true,
		        shadeClose : false,
		        area : [ '80%', '98%' ],
		        content : prefix + '/seeCommander/' + paras
		    });
		}
		
		function printDetail(obj) {
			var id = obj.children[0].value;
			var carId = obj.children[1].value;
			var paras = id + "," + carId;
		    layer.open({
		        id:'nodirect_seeCommander',
		        type : 2,
		        title : '打印清单',
		        maxmin : true,
		        shadeClose : false,
		        area : [ '80%', '95%' ],
		        content : prefix + '/printDetail/' + paras
		    });
		}
		
		function exportDetail(obj) {
			var id = obj.children[0].value;
			var carId = obj.children[1].value;
			var paras = id + "," + carId;
			window.location.href = prefix + "/exportDetail?paras="+paras;
		}
	</script>
</body>
</html>
